<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>九宫格加载</title>
    <style>
        :root{
            --grid-color : #487df9;
            --animation-duration : 1.8s;
        }

        body{
            display: flex;
            justify-content: center;
            justify-items: center;
            height: 100vh;
            margin: 0;
            background-color: #121212;
            font-family: "Inter", sans-serif;
        }

        .loader-container{
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .grid-loader{
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr);
            width: 600px;
            height: 600px;
            gap: 10px;
        }

        .grid-cell{
            background-color: var(--grid-color);
            border-radius: 12px;
            animation: pulse var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1) infinite;
            transform: scale(0.6);
            opacity: 0.3;
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(0.6);
                opacity: 0.3;
            }

            50% {
                transform: scale(1);
                opacity: 1;
            }
        }
    </style>
</head>
<body>
    <div class="loader-container">
        <div class="grid-loader" id="girdLoader"></div>
    </div>

    <script>
        const gridLoader = document.getElementById('girdLoader');
        const totalCells = 9;

        for(let i = 0; i< totalCells; i++) {
            const cell = document.createElement('div');
            cell.className = "grid-cell";
            cell.style.animationDelay = `${i * 0.1}s`
            gridLoader.appendChild(cell);
        }
    </script>
</body>
</html>